package com.funmi.lizip.controller;


import com.funmi.lizip.common.base.R;
import com.funmi.lizip.security.util.JwtTokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;


@Api(tags = "登录")
@RestController
@RequestMapping("/jLogin")
public class PhpLoginController {

    @ResponseStatus(HttpStatus.OK)
    @ApiOperation(value = "获取后台登录token")
    @PostMapping("/{username}")
    public R javaLogin(@PathVariable String username) throws Exception {
        String s = JwtTokenUtil.generateTokenByRSA(username);
        return R.success().data(s);
    }
}
